package com.songcha.module_mine.ui.activity.setting

import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.songcha.library_base.mvvm.base.BaseViewModel
import com.songcha.library_business.event.user.LogoutEvent
import com.songcha.library_business.provider.ILogoutProvider
import com.songcha.library_business.proxy.userinfo.UserInfoManager
import org.greenrobot.eventbus.EventBus

class SettingViewModel(app: Application):BaseViewModel<SettingRepository>(app){

    fun logout(){
        UserInfoManager.clearLogin()
        EventBus.getDefault().post(LogoutEvent())
        ARouter.getInstance().build("/task/DailyTaskController").navigation()?.let {
            (it as ILogoutProvider).onLogout()
        }
    }
}